package cn.ctodb.mall.goods.service.mapper;

import cn.ctodb.mall.goods.domain.*;
import cn.ctodb.mall.goods.service.dto.GoodsTypeDTO;

import org.mapstruct.*;
import java.util.List;

/**
 * Mapper for the entity GoodsType and its DTO GoodsTypeDTO.
 */
@Mapper(componentModel = "spring", uses = {})
public interface GoodsTypeMapper {

    GoodsTypeDTO goodsTypeToGoodsTypeDTO(GoodsType goodsType);

    List<GoodsTypeDTO> goodsTypesToGoodsTypeDTOs(List<GoodsType> goodsTypes);

    GoodsType goodsTypeDTOToGoodsType(GoodsTypeDTO goodsTypeDTO);

    List<GoodsType> goodsTypeDTOsToGoodsTypes(List<GoodsTypeDTO> goodsTypeDTOs);
    /**
     * generating the fromId for all mappers if the databaseType is sql, as the class has relationship to it might need it, instead of
     * creating a new attribute to know if the entity has any relationship from some other entity
     *
     * @param id id of the entity
     * @return the entity instance
     */
     
    default GoodsType goodsTypeFromId(Long id) {
        if (id == null) {
            return null;
        }
        GoodsType goodsType = new GoodsType();
        goodsType.setId(id);
        return goodsType;
    }
    

}
